
<template>
<div id="main" style="vertical-align:top;">
  <topbar id="topbar"></topbar>
  <div class="container">
    <sidebar id="sidebar" ></sidebar>
    <router-view ></router-view>
  </div>
</div>
</template>
<script>
import sidebar from './components/sidebar.vue'
import topbar from './components/topbar.vue'
export default {
  components: {
    sidebar,
    topbar
  },
  beforeCreate () {
    if (localStorage.getItem('user') === null) { this.$router.push({path: '/'}) }
  },
  data () {
    return {

    }
  }
}
</script>
<style scoped>

.container {
  display: flex;
  height: 100%;
}
#main{
  height: 100%;
}
router-view {
  flex: 1;
  padding: 20px;
}
#sidebar{
  height: 100%;
}
</style>
